<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // var regexp = new RegExp(/123/);
        // console.log(regexp);
        //只要包含都对
        // var rg = /123/;
        // var str = '123';
        // console.log(rg.test(str));
        var rg=/^abc$/;
        console.log(rg.test('aabcd'));
        
    </script>
</body>

</html>